package adminUserAccountHandler

import (
	exampleDtoApiPbAdminUserAccount "gitee.com/krio/ginc/example/dto/api/pb/admin/user/account"
	adminUserAccountService "gitee.com/krio/ginc/example/internal/admin/user/account/service"
	"github.com/gin-gonic/gin"
)

// AdminUserAccountAList 列表
func AdminUserAccountAList(ctx *gin.Context, req *exampleDtoApiPbAdminUserAccount.AdminUserAccountListReq) (*exampleDtoApiPbAdminUserAccount.AdminUserAccountListResp, error) {
	data, err := adminUserAccountService.AdminUserAccountList(ctx, req)
	if err != nil {
		return nil, err
	}

	return data, nil
}

// AdminUserAccountDetail 详情
func AdminUserAccountDetail(ctx *gin.Context, req *exampleDtoApiPbAdminUserAccount.AdminUserAccountDetailReq) (*exampleDtoApiPbAdminUserAccount.AdminUserAccountInfo, error) {
	data, err := adminUserAccountService.AdminUserAccountDetail(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
	panic("未实现")
}

// AdminUserAccountAdd 新增
func AdminUserAccountAdd(ctx *gin.Context, req *exampleDtoApiPbAdminUserAccount.AdminUserAccountInfo) (*exampleDtoApiPbAdminUserAccount.AdminUserAccountAddResp, error) {
	data, err := adminUserAccountService.AdminUserAccountAdd(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminUserAccountUpdate 修改
func AdminUserAccountUpdate(ctx *gin.Context, req *exampleDtoApiPbAdminUserAccount.AdminUserAccountInfo) (*exampleDtoApiPbAdminUserAccount.AdminUserAccountAddResp, error) {
	data, err := adminUserAccountService.AdminUserAccountUpdate(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}

// AdminUserAccountDelete 删除
func AdminUserAccountDelete(ctx *gin.Context, req *exampleDtoApiPbAdminUserAccount.AdminUserAccountDeleteReq) (*exampleDtoApiPbAdminUserAccount.AdminUserAccountDeleteResp, error) {
	data, err := adminUserAccountService.AdminUserAccountDelete(ctx, req)
	if err != nil {
		return nil, err
	}
	return data, nil
}
